/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package com.proyectos.model;

import java.math.BigDecimal;
import java.util.Date;
import java.util.Objects;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 *
 * @author Jose
 */
@Entity
@Table (name = "Hitos_matricula")
public class HitosMatricula {
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column
    private BigDecimal ncodigo;
    @ManyToOne
    @JoinColumn(name = "nmatricula")
    private Matriculas nmatricula;
    @ManyToOne
    @JoinColumn(name = "nhito")
    private Hitos nhito;
    @Temporal(TemporalType.TIMESTAMP)
    @Column(name = "dfecha")
    private Date dfecha;

    public HitosMatricula() {
        dfecha = new Date();
    }
    

    public Date getDfecha() {
        return dfecha;
    }

    public void setDfecha(Date dfecha) {
        this.dfecha = dfecha;
    }
    

    public BigDecimal getNcodigo() {
        return ncodigo;
    }

    public void setNcodigo(BigDecimal ncodigo) {
        this.ncodigo = ncodigo;
    }

    public Matriculas getNmatricula() {
        return nmatricula;
    }

    public void setNmatricula(Matriculas nmatricula) {
        this.nmatricula = nmatricula;
    }

    public Hitos getNhito() {
        return nhito;
    }

    public void setNhito(Hitos nhito) {
        this.nhito = nhito;
    }

    @Override
    public int hashCode() {
        int hash = 5;
        hash = 79 * hash + Objects.hashCode(this.nmatricula);
        hash = 79 * hash + Objects.hashCode(this.nhito);
        return hash;
    }

    @Override
    public boolean equals(Object obj) {
        if (obj == null) {
            return false;
        }
        if (getClass() != obj.getClass()) {
            return false;
        }
        final HitosMatricula other = (HitosMatricula) obj;
        if (!Objects.equals(this.nmatricula, other.nmatricula)) {
            return false;
        }
        if (!Objects.equals(this.nhito, other.nhito)) {
            return false;
        }
        return true;
    }
    

}
